package com.ross.dao;

import com.ross.pojo.SysPermissions;
import com.ross.pojo.SysRoles;
import com.ross.pojo.SysUsers;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUsersMapper {
    void correlationRoles(@Param("userId") Long userId, @Param("roleId") Long roleId);

    void uncorrelationRoles(@Param("userId") Long userId, @Param("roleId") Long roleId);

    List<SysRoles> findRoles(String username);

    List<SysPermissions> findPermissions(String username);

    boolean exists(@Param("userId") Long userId, @Param("roleId") Long roleId);

    void create(SysUsers user);

    void delete(Long id);

    void update(SysUsers user);

    List<SysUsers> findAll();

    SysUsers findByName(String username);

    SysUsers findById(Long id);

    void deleteAllUserRoles(Long id);

}